{% extends '../layouts/layout.html' %}

{% block scripts %}
<script src="/js/user/register.min.js"></script>
{% endblock %}

{% block styles %}
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/smoothness/jquery-ui.css">
{% endblock %}

{% block content %}

{% ifnotequal error 0 %}
<div class="ui-state-error error-msg">
  <p>
    <span class="ui-icon ui-icon-alert" style="float:left">&nbsp;</span>
    {% ifequal error 1 %}
    顯示名稱已經有人使用
    {% endifequal %}
  </p>
</div>
{% endifnotequal %}


<form method="post" action="/user/register" id="register-form">
  <fieldset>
    <input type="hidden" name="curl" value="{{ curl }}">
    <p>
      <label class="label" for="login_acct">登入的帳號:</label>
      <div class="field">
        <span id="login_acct">{{ login_acct.email  }}</span>
        <span class="text-hint">(不是你? 請<a href="/account/logout">登出</a>)</span>
      </div>
    </p>
    <p>
      <label class="label" for="username">顯示名稱:</label>
      <div class="field">
        <input type="text" name="username" id="username" size="30" autocomplete="off" tabindex="1">
        <br>
        <span class="text-hint">(以英文字母開頭，並以 A-Z, a-z, 0-9, 及 _ 所組成，長度需至少3個字元)</span>
      </div>
    </p>
    <p>
      <label class="label" for="email">收信的信箱:</label>
      <div class="field">
        <input type="text" name="email" id="email" size="30" autocomplete="off" tabindex="2"><br>
        <span class="text-hint">(論壇可能會發通知信給您，請填寫收得到信件的信箱)</span>
      </div>
    </p>
    <p>
      <label class="label">&nbsp;</label>
      <div class="field">
        <label for="tos">
          <input type="checkbox" id="tos" name="tos">
          我同意<a href="#" id="tos-link">使用者條款</a>
        </label>
      </div>
    </p>
    <p>
      <label class="label">&nbsp;</label>
      <input class="field" type="submit" value="註冊帳號">
    </p>
  </fieldset>
</form>
{% endblock %}
